module.exports = {
  devServer: {
    open: false,
    proxy: {
      '/m-next-api': {
        target: 'http://192.168.0.102:6001',
        ws: true,
        changeOrigin: true
      }
    }
  },
  css: {
    loaderOptions: {
      scss: {
        // 全局引入变量和 mixin
        additionalData: `
        @import "@/assets/styles/theme.scss";
        @import "@/assets/styles/mixin.scss";`
      }
    }
  },
  configureWebpack: (config) => {
    if (process.env.npm_config_report) {
      const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
      config.plugins.push(new BundleAnalyzerPlugin())
    }
  },
  productionSourceMap: false, // 生成环境是否开启源码查看
  publicPath: process.env.NODE_ENV === 'production' ? '/music-next/' : '/'
}
